package com.example.elmmerchants.SQL;

import android.util.Log;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Objects;

public class Connection_SQL {

    protected static String db = "elm";
    protected static String ip = "192.168.100.144";
    protected static String port = "3306";
    protected static String sql_name = "user"; //mongodb username 3283580957
    protected static String sql_password = "root";

    public Connection connection() {
        Connection conn = null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            String sql = "jdbc:mysql://" + ip + ":" + port + "/" + db;
            conn = DriverManager.getConnection(sql, sql_name, sql_password);
        } catch (Exception e) {
            Log.e("ERRO", Objects.requireNonNull(e.getMessage()));
        }
        return conn;
    }

}
